DROP TABLE IF EXISTS jms_dws.dws_waybill_hour_cnt_dt;
CREATE EXTERNAL TABLE jms_dws.dws_waybill_hour_cnt_dt(
  input_date             string      comment '运单录入日期'
 ,input_hour             string      comment '运单录入小时'
 ,pick_network_code      string      comment '寄件网点编码'
 ,pick_network_name      string      comment '寄件网点名称'
 ,waybill_source_code    string      comment '运单来源编号'
 ,waybill_source_name    string      comment '运单来源名称'
 ,sender_province_name   string      comment '省'
 ,sender_city_name       string      comment '市'
 ,sender_area_name       string      comment '区县'
 ,franchisee_code        string      comment '加盟商编码'
 ,franchisee_name        string      comment '加盟商名称'
 ,agent_code             string      comment '代理区code'
 ,agent_name             string      comment '代理区名称'
 ,cnt                    bigint      comment '数量'
 )
 COMMENT '运单综合统计汇总表'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_dws.db/external/dws_waybill_hour_cnt_dt'
 TBLPROPERTIES (
 'parquet.column.index.access'='true'
 );

 DROP TABLE IF EXISTS jms_dws.dws_waybill_day_cnt_dt;
CREATE EXTERNAL TABLE jms_dws.dws_waybill_day_cnt_dt(
  input_date             string      comment '运单录入日期'
 ,pick_network_code      string      comment '寄件网点编码'
 ,pick_network_name      string      comment '寄件网点名称'
 ,waybill_source_code    string      comment '运单来源编号'
 ,waybill_source_name    string      comment '运单来源名称'
 ,sender_province_name   string      comment '省'
 ,sender_city_name       string      comment '市'
 ,sender_area_name       string      comment '区县'
 ,franchisee_code        string      comment '加盟商编码'
 ,franchisee_name        string      comment '加盟商名称'
 ,agent_code             string      comment '代理区code'
 ,agent_name             string      comment '代理区名称'
 ,cnt                    bigint      comment '数量'
 )
 COMMENT '运单综合统计汇总表'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_dws.db/external/dws_waybill_day_cnt_dt'
 TBLPROPERTIES (
 'parquet.column.index.access'='true'
 );

